package com.zhuiyun.project.api.userrecord.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhuiyun.project.api.caseImage.entity.CaseImage;
import com.zhuiyun.project.api.coachmanagement.entity.CoachManagement;
import com.zhuiyun.project.api.coachmanagement.model.CoachIdModel;
import com.zhuiyun.project.api.memberUserManagement.entity.MemberUserManagement;
import com.zhuiyun.project.api.reservation.entity.Reservation;
import com.zhuiyun.project.api.userrecord.entity.StudentCaseRecords;
import com.zhuiyun.project.api.userrecord.entity.UserRecord;
import com.zhuiyun.project.api.userrecord.model.*;
import com.zhuiyun.project.utils.pageUtil.PageRequest;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @InterfaceName UserRecordMapper
 * @Description TODO
 * @Author wuwan
 * @Date 2023/11/20 14:51
 **/
@Mapper
public interface UserRecordMapper extends BaseMapper<UserRecord> {
    /*
     * @Author wuwan
     * @Description 上传学员课程记录
     * @Date 2023/11/20 15:08
     * @Return
     */
    Integer uploadUserRecord(UserRecord userRecord);
    /*
     * @Author wuwan
     * @Description 查询学员的身体参数 身高体重年龄性别 用于计算体脂率
     * @Date 2023/11/21 10:56
     * @Return
     */
    BodyFatModel selectBodyFat(Integer memberUserId);

    UserRecord selectByUser(Integer memberUserId,Integer recordId);

    Integer updateUserRecord(UpdateUserRecordModel updateUserRecordModel);
    /*
     * @Author wuwan
     * @Description 查询所有记录
     * @Date 2023/11/23 11:09
     * @Return
     */
    List<SelectUserInformationModel> selectUserInformation(Integer recordId);
    /*
     * @Author wuwan
     * @Description 将用户记录提交到案例表
     * @Date 2023/11/23 11:08
     * @Return
     */
    Integer addCaseRecords(AddCaseRecordsModel addCaseRecordsModel);
    /*
     * @Author wuwan
     * @Description 查询第一次锻炼时间 用于统计锻炼天数
     * @Date 2023/11/23 11:08
     * @Return
     */
    UserRecord selectUserTrainingTime(Integer memberId);
    /*
     * @Author wuwan
     * @Description 查询所有学员案例
     * @Date 2023/11/24 10:34
     * @Return
     */
    List<StudentCaseRecordsModel> selectUserCase(Integer tid,Integer caseStatus);
    /*
     * @Author wuwan
     * @Description 查询指定用户的原来现在体脂 和 原来现在体重
     * @Date 2023/11/24 10:35
     * @Return
     */
    SelectUserInformationModel selectUserInformationById(Integer uid,Integer tid);
    /*
    * @Author wuwan
    * @Description 根据会员id查询出会员名称
    * @Date 2023/11/28 20:26
    * @Return
    */
    MemberUserManagement getByUserName(Integer uid);
    /*
    * @Author wuwan
    * @Description 根据教练id查询出场馆唯一标识符
    * @Date 2023/11/28 20:26
    * @Return
    */
    CoachManagement getByCoachVenueId(Integer tid);

    /**
     * @Author wx
     * @Description 根据学员编号 教练编号查询案例
     * @Date 2023/12/4 13:53
     * @Return
     * @param coachId,memberId
     */
    List<UserRecord> selectTeacherCase( Integer coachId);

    /**
    * @Author wx
    * @Description 查询学院案例照片
    * @Date 2023/12/4 15:01
    * @Return
    * @param coachIdInRecord
    */
    List<CaseImage> selectCasePhoto(Integer memberId, Integer coachIdInRecord);

    /**
    * @Author wx
    * @Description 查询用户现体重现体脂
    * @Date 2023/12/12 9:29
    * @Return
    * @param memberId
    */
    UserRecord selectWeightHeight(Integer memberId, Integer coachIdInRecord);

    /**
     * @Author wx
     * @Description 修改案例评分
     * @Date 2023/12/12 14:48
     * @Return
     * @param fraction
     */
    int updateCsaeFroctionById(String fraction, Integer coachId, Integer memberUserId);

    /**
     * @Author wx
     * @Description 查询学员案例
     * @Date 2023/12/12 15:01
     * @Return
     * @param pageRequest,venueUniqueIdentifier
     */
    List<UserRecord> selectUserRecordByUserId(PageRequest pageRequest, @RequestParam String venueUniqueIdentifier);
}